<template>
  <div></div>
</template>

<script>
export default {
  mounted() {
    // 每一个组件（vm,vc）都是Vue的实例
    const $map = this.$map;
    $map.on("click", (evt) => {
      var layer = $map.getLayers().array_[1];
      var visible = layer.get("visible");
      if (visible) {
        layer.setVisible(false);
      } else {
        layer.setVisible(true);
      }
    });
  },
};
</script>

<style scoped></style>
